查询 Refund 对象列表

返回之前创建 charge 对象的一个 refund 对象列表。列表是按创建时间进行排序,总是将最新的 refund 对象显示在最前。

请求参数描述
CHARGE_ID required string指定退款所在 charge 对象的 id,该参数仅需要填写在请求地址内。
limit optional int限制每页可以返回多少对象,范围为 1~100 项,默认是 10 项。
starting_after optional string在分页时使用的指针,决定了列表的第一项从何处开始。假设你的一次请求返回列表的最后一项的 idobj_end,你可以使用 starting_after = obj_end 去获取下一页。
ending_before optional string在分页时使用的指针,决定了列表的最末项在何处结束。假设你的一次请求返回列表的第一项的 idobj_start,你可以使用 ending_before = obj_start 去获取上一页。

返回

根据请求参数返回一个 refund 对象列表,如果列表为空,则返回的 data 为空数组。遇到错误时返回相应错误信息,详见 错误

定义

GET https://api.pingxx.com/v1/charges/{CHARGE_ID}/refunds
\Pingpp\Charge::retrieve({CHARGE_ID})->refunds->all();
Charge.retrieve({CHARGE_ID}).getRefunds().all();
Pingpp::Charge.retrieve({CHARGE_ID}).refunds.all
pingpp.charges.listRefunds({CHARGE_ID});
ch = pingpp.Charge.retrieve('CHARGE_ID')
res = ch.refunds.all(limit=3)
refund.List("CHARGE_ID", &pingpp.RefundListParams)
list(String chId, Dictionary<String, Object> params)

请求示例

curl https://api.pingxx.com/v1/charges/ch_L8qn10mLmr1GS8e5OODmHaL4/refunds?limit=3 \
-u sk_test_ibbTe5jLGCi5rzfH4OqPW9KC:
\Pingpp\Pingpp::setApiKey('sk_test_ibbTe5jLGCi5rzfH4OqPW9KC');

\Pingpp\Charge::retrieve('ch_L8qn10mLmr1GS8e5OODmHaL4')
->refunds->all(array('limit'=>3));
Pingpp.apiKey = "sk_test_ibbTe5jLGCi5rzfH4OqPW9KC";

Charge ch = Charge.retrieve("ch_L8qn10mLmr1GS8e5OODmHaL4");
Map<String, Object> refundParams = new HashMap<String, Object>();
refundParams.put("limit", 3);
ChargeRefundCollection refunds = ch.getRefunds().all(refundParams);
Pingpp.api_key = "sk_test_ibbTe5jLGCi5rzfH4OqPW9KC"
Pingpp::Charge.retrieve("ch_L8qn10mLmr1GS8e5OODmHaL4").refunds.all({:limit => 3})
var pingpp = require('pingpp')('sk_test_ibbTe5jLGCi5rzfH4OqPW9KC');
pingpp.charges.listRefunds(
 "ch_L8qn10mLmr1GS8e5OODmHaL4",
 { limit: 3 },
   function(err, refunds) {
     // 异步调用
   }
);
pingpp.api_key = 'sk_test_ibbTe5jLGCi5rzfH4OqPW9KC'
ch = pingpp.Charge.retrieve('ch_L8qn10mLmr1GS8e5OODmHaL4')
res = ch.refunds.all(limit=3)
pingpp.Key = "sk_test_ibbTe5jLGCi5rzfH4OqPW9KC"
params := &pingpp.RefundListParams{}
params.Filters.AddFilter("limit", "", "3")
params.Single = true
i := refund.List("ch_L8qn10mLmr1GS8e5OODmHaL4", params)
for i.Next() {
  c := i.Refund()
}
Dictionary<String, Object> refundParams = new Dictionary<String, Object>();
refundParams.Add("limit", 3);
try {
    RefundList res = Refund.list(chId, refundParams);
    Console.WriteLine(res);
} catch (AuthenticationException e) {
    Console.WriteLine(e.Message.ToString());
}

返回示例

{
  "object": "list",
  "url": "/v1/charges/ch_L8qn10mLmr1GS8e5OODmHaL4/refunds",
  "has_more": false,
  "data": [
	    {
		  "id": "re_y1u944PmfnrTHyvnL0nD0iD1",
		  "object": "refund",
		  "order_no": "y1u944PmfnrTHyvnL0nD0iD1",
		  "amount": 1,
		  "created": 1409634160,
		  "succeed": true,
		  "status": "succeeded",
		  "time_succeed": 1409634192,
		  "description": "Refund Description",
		  "failure_code": null,
		  "failure_msg": null,
		  "metadata": {},
		  "charge": "ch_L8qn10mLmr1GS8e5OODmHaL4",
		  "charge_order_no": "123456789",
		  "transaction_no": "2004450349201512090096425284",
		  "funding_source": null,
		  "extra": {}
		}
	}
  ]
}